import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import '../constant.dart';

class AMapController {
  final MethodChannel mapChannel;

  AMapController.withId(int id) : mapChannel = MethodChannel('$AMAP_CHANNEL_NAME/map$id');


  ///更改线路顺序
  ///参数:根据数据定制型方法,参数请参考dart/Android/iOS代码
  Future<bool> changeList(Map<String, dynamic> map) async {
    debugPrint('方法:changeList dart端参数:-> $map');
    return await mapChannel.invokeMethod("changeList", map);
  }

  ///查看固定点
  ///参数:根据数据定制型方法,参数请参考dart/Android/iOS代码
  Future<bool> checkPoint(Map<String, dynamic> map) async {
    debugPrint('方法:checkPoint dart端参数:-> $map');
    return await mapChannel.invokeMethod("checkPoint", map);
  }

  ///设置地图的缩放比例 地图的缩放级别一共分为 17 级，从 3 到 19。数字越大，展示的图面信息越精细。
  ///参数: Map<String, dynamic> locationMap = {"num": int};
  Future<bool> setZoomTo(Map<String, dynamic> map) async {
    debugPrint('方法:setZoomTo dart端参数:-> $map');
    return await mapChannel.invokeMethod("setZoomTo", map);
  }

  ///~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  ///线路开始
  ///因相应功能废弃,这里弃用~
  Future<bool> linRun(Map<String, dynamic> map) async {
    debugPrint('方法:linRun dart端参数:-> $map');
    return await mapChannel.invokeMethod("linRun", map);
  }

}